﻿/*-----------------------------------------------
// File: BuffSource.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.Engine.LogicModel
{
    public interface IBuffOrigin {
        BuffSourceClass GetBuffSourceClass();
        string GetSourceUniqueId();

        string GetDesc();

        FActor GetSourceActor();
    }

    // 释放技能造成BUFF
    public class SkillCastBuffOrigin : IBuffOrigin {
        public BuffSourceClass GetBuffSourceClass() { return BuffSourceClass.SKILLCAST; }
        public FActor sourceActor;
        public FSkill sourceSkill;
        public FSkillCast sourceSkillCast;
        public SkillCastBuffOrigin(FSkillCast sourceCast) {
            sourceSkillCast = sourceCast;
            sourceSkill = sourceSkillCast.skill;
            sourceActor = sourceSkill.actor;
        }
        public string GetSourceUniqueId() {
            return sourceActor.uniqueId;
        }
        public string GetDesc() {
            return "[" + sourceActor.uniqueId + "]" + sourceActor.heroData.name + " At SkillRelease " + sourceSkillCast.id;
        }
        public FActor GetSourceActor()
        {
            return sourceActor;
        }
    }

    //天赋触发BUFF
    public class TalentBuffOrigin : IBuffOrigin {
        public BuffSourceClass GetBuffSourceClass() { return BuffSourceClass.HERO; }
        public FActor sourceActor;
        public FTalent sourceTalent;
        public TalentBuffOrigin(FTalent talent) {
            sourceTalent = talent;
            sourceActor = talent.actor;
        }

        public string GetSourceUniqueId() {
            return sourceActor.uniqueId;
        }

        public string GetDesc() {
            return "[" + sourceActor.uniqueId + "]" + sourceActor.heroData.name + " At Talent " + sourceTalent.id;
        }
        public FActor GetSourceActor()
        {
            return sourceActor;
        }
    }

}